package qscript;

import org.qscript.Vector;

import processing.core.PApplet;
import processing.core.PVector;

public class TestVector1 {

	public void run(){
		
		testAngleBetween();
		
	}
	
	public void testAngleBetween(){
		Vector org = new Vector(10,20,30);
		Vector v1 = new Vector(110,320,30);
		Vector v2 = new Vector(110,-320,-30);
		double a = Vector.angleBetween(org,v1,v2);
		
		System.out.println(Math.toDegrees(a));
		
		PVector porg = getPVector(org);
		PVector pv1 = getPVector(v1);
		PVector pv2 = getPVector(v2);
		float pa = PVector.angleBetween(PVector.sub(pv1, porg), PVector.sub(pv2, porg));
		System.out.println(PApplet.degrees(pa));
		
	
	}

	public PVector getPVector(Vector v){
		return new PVector((float)v.x, (float)v.y, (float)v.z);
	}
	
	public Vector getVector(PVector v){
		return new Vector(v.x, v.y, v.z);
	}
	
	public static void main(String[] args) {
		TestVector1 that = new TestVector1();
		that.run();

		System.out.println("\nPROGRAM EXIT");
		System.exit(0);
	}
}


